package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;

/**
 * @author hekelong
 * @date 2025/11/11 16:54
 */
public class JinMaoUtil {

    public static Integer getZhimaScore(String zhima) {
        if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm002.getValue(), zhima) || StrUtil.equals(BaseTypeInfoEnum.Zhima.zm002.getValue(), zhima)) {
            return 1;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm003.getValue(), zhima)) {
            return 2;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm004.getValue(), zhima)) {
            return 3;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm005.getValue(), zhima)) {
            return 4;
        }
        return 0;
    }

    public static Integer getHuaBei(String huabei) {
        if (StrUtil.equals(BaseTypeInfoEnum.Huabei.hb001.getValue(), huabei)) {
            return 0;
        }
        return 1;
    }

    public static Integer getBaiTiao(String baitiao) {
        if (StrUtil.equals(BaseTypeInfoEnum.Baitiao.bt001.getValue(), baitiao)) {
            return 0;
        }
        return 1;
    }

    public static Integer getYuQi(String yuqi) {
        if (StrUtil.equals(BaseTypeInfoEnum.Yuqi.yq001.getValue(), yuqi)) {
            return 0;
        }
        return 1;
    }

    public static Integer getLoanAmount(String loanAmount) {
        if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la001.getValue(), loanAmount) || StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la002.getValue(), loanAmount)) {
            return 1;
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la004.getValue(), loanAmount) || StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la003.getValue(), loanAmount)) {
            return 2;
        }
        return 3;
    }

    public static Integer getXueli(String xueli) {
        if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl001.getValue(), xueli) || StrUtil.equals(BaseTypeInfoEnum.XueLi.xl002.getValue(), xueli)) {
            return 1;
        } else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl003.getValue(), xueli)) {
            return 3;
        }
        return 4;
    }

    public static Integer getSheBao(String shebao) {
        if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb001.getValue(), shebao)) {
            return 0;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb003.getValue(), shebao)) {
            return 2;
        }
        return 1;
    }

    public static Integer getXinYongKa(String xinyongka) {
        if (StrUtil.equals(BaseTypeInfoEnum.XinYongKa.xyk002.getValue(), xinyongka)) {
            return 1;
        }
        return 0;
    }

    //职业
    public static Integer getjob(String job) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz002.getValue(), job)) {
            return 3;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz001.getValue(), job)) {
            return 2;
        }
        return 1;
    }

    public static Integer getGjj(String gongjijin) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj001.getValue(), gongjijin)) {
            return 0;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj003.getValue(), gongjijin)) {
            return 2;
        }
        return 1;
    }

    public static Integer getBaoXian(String baoxian) {
        if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx002.getValue(), baoxian)) {
            return 1;
        }
        return 0;
    }

    public static Integer getCar(String car) {
        if (StrUtil.equals(BaseTypeInfoEnum.Car.car002.getValue(), car)) {
            return 1;
        }
        return 0;
    }

    public static Integer getHouse(String house) {
        if (StrUtil.equals(BaseTypeInfoEnum.House.hu002.getValue(), house)) {
            return 2;
        }
        return 0;
    }

}
